home *** CD-ROM | disk | FTP | other *** search
/ Old Testament Foundatiosn with Philip Yancey / Old Testament Foundatiosn with Philip Yancey - Disc 1.iso / pc / data / shared.dir / 00864.ls < prev    next >
Encoding:
Text File  |  1996-09-06  |  2.1 KB  |  66 lines

  1. on printBitmap theCast
  2.   if the castType of cast theCast <> #bitmap then
  3.     alert("PrintBitmap can only print bitmapped castmembers.")
  4.     exit
  5.   end if
  6.   if the machineType = 256 then
  7.     set XObjFile to "pmatic.dll"
  8.     set printingFont to "arial"
  9.   else
  10.     set XObjFile to "pmatic.xobj"
  11.     set printingFont to "geneva"
  12.   end if
  13.   openXLib(XObjFile)
  14.   set printer to PrintOMatic(mnew)
  15.   if not objectp(printer) then
  16.     alert("There is no currently selected printer. Printing features are disabled.")
  17.   else
  18.     printer(mRegister, "PMAT130-915-01021")
  19.     printer(mSetMargins, 72, 72, 72, 100)
  20.     set pw to printer(mGetPageWidth)
  21.     set ph to printer(mGetPageHeight)
  22.     set w to the width of cast theCast
  23.     set h to the height of cast theCast
  24.     set scaling to min(float(pw) / float(w), float(ph) / float(h))
  25.     if (scaling < 1.0) and (w > h) then
  26.       printer(mSetLandscapeMode, 1)
  27.       set pw to printer(mGetPageWidth)
  28.       set ph to printer(mGetPageHeight)
  29.       set scaling to min(float(pw) / float(w), float(ph) / float(h))
  30.     end if
  31.     set scaling to min(scaling, 1.0)
  32.     set w to integer(w * scaling)
  33.     set h to integer(h * scaling)
  34.     set left to (pw - w) / 2
  35.     set top to (ph - h) / 2
  36.     printer(mSetPageNumSymbol, "√û")
  37.     printer(mSetTextFont, printingFont)
  38.     printer(mSetTextSize, 10)
  39.     printer(mSetTextStyle, "normal,italic")
  40.     printer(mSetTextJust, "left")
  41.     printer(mDrawText, "Copyright Sky Media/Discovery House Publishers, 1996", 0, ph + 40)
  42.     printer(mSetTextJust, "center")
  43.     printer(mDrawText, "page √û", (pw / 2) + 80, ph + 40)
  44.     printer(mSetTextJust, "right")
  45.     printer(mDrawText, "printed" && the date, pw, ph + 40)
  46.     printer(mLine, 0, ph + 20, pw, ph + 20)
  47.     printer(mSetProgressMsg, "Now Printing Discovery Interactive Document")
  48.     printer(mNewPage)
  49.     printer(mPicture, the picture of cast theCast, left, top, left + w, top + h)
  50.     if printer(mDoJobSetup) = 1 then
  51.       updateStage()
  52.       printer(mPrint)
  53.     end if
  54.     printer(mdispose)
  55.   end if
  56.   closeXLib(XObjFile)
  57. end
  58.  
  59. on min a, b
  60.   if a < b then
  61.     return a
  62.   else
  63.     return b
  64.   end if
  65. end
  66.